package com.ruoyi.merchant.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.MerchantDataCountInfoMapper;
import com.ruoyi.db.domain.MerchantDataCountInfo;
import com.ruoyi.merchant.service.IMerchantDataCountInfoService;

/**
 * 商户数据统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-19
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class MerchantDataCountInfoServiceImpl implements IMerchantDataCountInfoService 
{
    @Autowired
    private MerchantDataCountInfoMapper merchantDataCountInfoMapper;

    /**
     * 查询商户数据统计
     * 
     * @param id 商户数据统计主键
     * @return 商户数据统计
     */
    @Override
    public MerchantDataCountInfo selectMerchantDataCountInfoById(Long id)
    {
        return merchantDataCountInfoMapper.selectMerchantDataCountInfoById(id);
    }

    /**
     * 查询商户数据统计列表
     * 
     * @param merchantDataCountInfo 商户数据统计
     * @return 商户数据统计
     */
    @Override
    public List<MerchantDataCountInfo> selectMerchantDataCountInfoList(MerchantDataCountInfo merchantDataCountInfo)
    {
        return merchantDataCountInfoMapper.selectMerchantDataCountInfoList(merchantDataCountInfo);
    }

    /**
     * 查询商户数据统计列表
     *
     * @param merchantDataCountInfo 商户数据统计
     * @return 商户数据统计
     */
    @Override
    public List<Map<String, Object>> selectMerchantDataCountInfoMapList(MerchantDataCountInfo merchantDataCountInfo)
    {
        return merchantDataCountInfoMapper.selectMerchantDataCountInfoMapList(merchantDataCountInfo);
    }

    /**
     * 新增商户数据统计
     * 
     * @param merchantDataCountInfo 商户数据统计
     * @return 结果
     */
    @Override
    public int insertMerchantDataCountInfo(MerchantDataCountInfo merchantDataCountInfo)
    {
        merchantDataCountInfo.setCreateTime(DateUtils.getNowDate());
        return merchantDataCountInfoMapper.insertMerchantDataCountInfo(merchantDataCountInfo);
    }

    /**
     * 修改商户数据统计
     * 
     * @param merchantDataCountInfo 商户数据统计
     * @return 结果
     */
    @Override
    public int updateMerchantDataCountInfo(MerchantDataCountInfo merchantDataCountInfo)
    {
        merchantDataCountInfo.setUpdateTime(DateUtils.getNowDate());
        return merchantDataCountInfoMapper.updateMerchantDataCountInfo(merchantDataCountInfo);
    }

    /**
     * 批量删除商户数据统计
     * 
     * @param ids 需要删除的商户数据统计主键
     * @return 结果
     */
    @Override
    public int deleteMerchantDataCountInfoByIds(Long[] ids)
    {
        return merchantDataCountInfoMapper.deleteMerchantDataCountInfoByIds(ids);
    }

    /**
     * 删除商户数据统计信息
     * 
     * @param id 商户数据统计主键
     * @return 结果
     */
    @Override
    public int deleteMerchantDataCountInfoById(Long id)
    {
        return merchantDataCountInfoMapper.deleteMerchantDataCountInfoById(id);
    }
}
